import Login from '../pages/Login';
import Home from '../pages/Home';
import Product from '../pages/Product';
import Order from '../pages/Order/OrderPage';
import OrderDetail from '../pages/Order/Detail';
import OrderEdit from '../pages/Order/Edit';
import Error from '../pages/Error';
import AuthLayout from '../components/AuthLayout';
import MenuPage from "../pages/Menu/MenuPage";
import RolePage from "../pages/Role/RolePage";
import UserPage from "../pages/User/UserPage";
import ProductEdit from "../pages/Product/Edit";
import ProductDetail from "../pages/Product/Detail";

// 路由配置
const routesConfig = [
  { path: '/login', element: <Login /> },
  {
    path: '/',
    element: <AuthLayout />,
    children: [
      { path: '/', element: <Home /> },
      //   商品部分
      { path: '/product', element: <Product /> },
      { path: '/product/add', element: <ProductEdit/> },
      { path: '/product/edit/:id', element: <ProductEdit/> },
      { path: '/product/:id', element: <ProductDetail /> },
      // 订单部分
      { path: '/order', element: <Order /> },
      { path: '/order/add', element: <OrderEdit /> },
      { path: '/order/edit/:id', element: <OrderEdit /> },
      { path: '/order/:id', element: <OrderDetail /> },
      //   权限管理部分
      { path: '/role', element: <RolePage /> },
      { path: '/user', element: <UserPage /> },
      { path: '/menu', element: <MenuPage /> },
      { path: '*', element: <Error /> },

    ],
  },
];

export default routesConfig;
